<template>
  <div>
    <div class="header">所有应用</div>
    <div class="search">
      <div>全部&nbsp;<el-icon>
          <CaretBottom />
        </el-icon></div>
      <div class="search-box">
        <el-input style="width: 180px" placeholder="搜索" :prefix-icon="Search" />
        <div v-if="flex">
          <div class="xin" @mouseover="flex = true">新建 &nbsp;<el-icon>
              <ArrowUp />
            </el-icon></div>
          <div class="app">
            <ul>
              <li @click="()=>{router.push(`/applica`)}"><el-icon><Orange style="color:rgb(54, 154, 249);"/></el-icon>&nbsp;应用</li>
            </ul>
          </div>
        </div>
        <div class="xin" v-else @mouseover="flex = true" @mouseleave="flex = false">新建 &nbsp;<el-icon>
            <ArrowDown />
          </el-icon></div>
        <div class="xin"><el-icon>
            <Folder />
          </el-icon>批量导出</div>
      </div>
    </div>

  </div>
</template>

<script setup>
import { CaretBottom, Search, Folder, ArrowDown, ArrowUp,Orange } from '@element-plus/icons-vue'
import { useRouter } from 'vue-router'
import axios from 'axios'
axios.defaults.baseURL = 'http://127.0.0.1:3000'
import { onMounted, ref } from 'vue'
let app = ref([])
let flex = ref(false)
let router = useRouter()
// let getAppCoe = async () => {
//   let res = await axios.get('/getApp')
//   app.value = res.data.data
// }
// onMounted(() => {
//   getAppCoe()
// })
// function go(id){
//   router.push(`/applica/${id}`)
// }
</script>

<style scoped>
* {
  margin: 0px;
  padding: 0px;
  list-style: none;
}

.header {
  line-height: 100px;
  height: 100px;
  /* background: red; */
  border-radius: 20px 20px 0px 0px;
  font-size: 25px;
  padding-left: 30px;
  color: #fff;
  animation: colorChange 10s infinite
}

@keyframes colorChange {
  0% {
    background-color: rgb(3, 182, 247);
  }

  50% {
    background-color: rgb(113, 217, 245);
  }

  100% {
    background-color: rgb(113, 217, 245);
  }
}

.search {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30px;
  height: 80px;
  background: #fff;
  border-radius: 20px 20px 0 0;
  border-bottom: 1px solid #ccc;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 20px;
}

.xin {
  width: 100px;
  height: 30px;
  background: rgb(73, 101, 242);
  color: #fff;
  border-radius: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer
}

.app {
  width: 110px;
  height: 200px;
  background: #fff;
  border-radius: 10px;
  position: absolute;
  top: 263px;
  right: 180px;
  font-size: 13px;
  box-shadow: 0px 0px 10px 0px #ccc;
}

ul {
  width: 110px;
  height: 28px;
  line-height: 28px;
}
li{
  margin-left: 10px;
}
</style>